package com.boot.system.entity;

import com.boot.common.entity.BaseEntity;
import com.boot.system.entity.listener.MenuOnSetListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 菜单实体
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value = "sys_menu", onSet = MenuOnSetListener.class)
public class SysMenu extends BaseEntity {

    /**
     * 菜单名称
     */
    @Column(value = "name")
    private String name;

    /**
     * 父菜单ID
     */
    @Column(value = "pid")
    private Long pid;

    /**
     * 菜单类型(1-目录 2-菜单 3-外链)
     */
    @Column(value = "type")
    private Integer type;

    /**
     * 菜单地址
     */
    @Column(value = "path")
    private String path;

    /**
     * 排序
     */
    @Column(value = "sort")
    private Integer sort;

    /**
     * 菜单图标
     */
    @Column(value = "icon")
    private String icon;

    /**
     * 状态
     * 1=正常 0=停用
     */
    @Column(value = "status")
    private Integer status;

    /**
     * 角色字符串
     */
    @Column(value = "roles")
    private String roles;

    /**
     * 角色数组
     */
    @Column(ignore = true)
    private String[] roleArr;

    /**
     * 子节点
     */
    @Column(ignore = true)
    private List<SysMenu> children;
}